/*
 * @Description: 查询内容全局状态
 * @Autor: zhangzhanhua
 * @Date: 2021-04-23 14:09:16
 * @LastEditors: zhangzhanhua
 * @LastEditTime: 2021-04-27 10:08:01
 */
import {
    Service as $http,ServiceName
} from '../../network/http.js'
const dictionaries = {
    state: {
        workCompsList: [], //作业公司列表
        workTimeList:[],//班次列表
    },
    mutations: {},
    actions: {
        //获取全部所需的查询数据入口
        getSearchData(ctx) {
            ctx.dispatch('getWorkCompsList') //获取作业公司
            // ctx.dispatch('getWorkTimeList') //获取班次
        },

        //获取作业公司
        getWorkCompsList(ctx) {
            $http.get(`/${ServiceName}/api/external/publics/listworkcompany`).then(res => {
                if (res.data.success) {
                    ctx.state.workCompsList = res.data.data
                }
            })
        },
        //获取班次
        getWorkTimeList(ctx) {
            $http.get(`/${ServiceName}/api/external/protected/listschedulebyareacode`).then(res => {
                if (res.data.success) {
                    ctx.state.workTimeList = res.data.data
                }
            })
        }
    },
};

export default dictionaries;
